#pragma once
#include <functional>
#include <vector>
#include "../sqlite/sqlite3.h"
#include "../logger/BackupFSLogger.h"
/*
* Sqlite operation
*/
namespace BackupFS
{
	class BackupFSDB
	{
	public:
		BackupFSDB();
		virtual ~BackupFSDB();
	public:
		/*
		Init the sqlite database file
		*/
		bool Init(const std::wstring& file_name, bool& has_db);
		void Close();
		bool TableExist(const std::string& table_name);
		bool Select(const std::string& sql, std::function<void(sqlite3_stmt*)> callback);
		bool Execute(const std::string& sql);
		sqlite3* GetDb() { return _Db; }
	private:
	private:
		sqlite3* _Db = nullptr;
		std::wstring _FileName;
		std::vector<std::string>_InitSqls;
	};

}